/*
 * @Author: 杨光辉(GerhardYang)
 * @Date: 2020-12-14 13:09:24
 * @LastEditors: 杨光辉(GerhardYang)
 * @LastEditTime: 2021-06-04 12:16:31
 * @Description: file content
 * @Copyright: 超图软件华中平台客户中心 (SuperMap Software Co., Ltd. -Central China Platform)
 */
import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    map: undefined, //全局地图对象
    config: {
      SearchLayers: {},
      SearchLayersNodes: {},
      SearchMapoptions: {}, //默认地图参数
      SearchAreas: {},
    },
    checkedLayers: [], //图层树选中的图层
    Details: {
      visiable: false,
      data: [],
    },
    areaCode: [],
    isShowTools: true,
    userName: null,
    tagitem: undefined,
  },
  mutations: {
    setCheckedLayers(state, payload) {
      state.checkedLayers = payload;
    },
    setUserName(state, payload) {
      state.userName = payload;
    },
    setSearchLayers(state, payload) {
      state.config.SearchLayers = payload;
    },
    setSearchLayersNodes(state, payload) {
      state.config.SearchLayersNodes = payload;
    },
    setSearchMapoptions(state, payload) {
      state.config.SearchMapoptions = payload;
    },
    setSearchAreas(state, payload) {
      state.config.SearchAreas = payload;
    },
    setMap(state, payload) {
      state.map = payload;
    },
    setAreaCode(state, code) {
      state.areaCode = code;
    },
    setisShowTools(state, boolean) {
      state.isShowTools = boolean;
    },
    setTagitem(state, payload) {
      state.tagitem = payload;
    },
  },
  actions: {},
  modules: {},
});
